import request from '@/common/request'

export function gettype (data) {
  return request({
    url: '/api/type/all',
    method: 'post',
    data
  })
}

export function removetype (id) {
  return request({
    url: '/api/type/del/' + id,
    method: 'post'
  })
}

export function refreshtype (query) {
  return request({
    url: '/api/type/refresh',
    method: 'post'
  })
}

export function addtype (data) {
  return request({
    url: '/api/type/add',
    method: 'post',
    data
  })
}

export function updatetype (data) {
  return request({
    url: '/api/type/edit',
    method: 'post',
    data
  })
}

export function getxiala (type) {
  return request({
    url: '/api/enum/getEnum?type=' + type,
    method: 'get'
  })
}

export function getdata (data) {
  return request({
    url: '/api/data/all',
    method: 'post',
    data
  })
}

export function removedata (id) {
  return request({
    url: '/api/data/del/' + id,
    method: 'post'
  })
}

export function refreshdata (allDictType) {
  return request({
    url: '/api/data/refresh/' + allDictType,
    method: 'post'
  })
}

export function adddata (data) {
  return request({
    url: '/api/data/add',
    method: 'post',
    data
  })
}

export function updatedata (data) {
  return request({
    url: '/api/data/edit',
    method: 'post',
    data
  })
}
